/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface MesOrderTask extends BasicModel<MesOrderTask> {
  modid?: string; // 订单子表ID
  operCode?: string; // 工序编码
  linefpId?: string; // 分配ID
  routeId?: string; // 工艺ID
  invCode?: string; // 存货编码
  iqty?: number; // 加工数量
  iprice?: number; // 计件单价
  planStartDate?: string; // 计划开始
  planOverDate?: string; // 计划结束
  sumOverQty?: number; // 完工数
  sumOkQty?: number; // 合格数
  taskStatus?: string; // 任务状态
}

export const mesOrderTaskList = (params?: MesOrderTask | any) =>
  defHttp.get<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/list', params });

export const mesOrderTaskListData = (params?: MesOrderTask | any) =>
  defHttp.post<Page<MesOrderTask>>({ url: adminPath + '/mo/task/mesOrderTask/listData', params });

export const mesOrderTaskForm = (params?: MesOrderTask | any) =>
  defHttp.get<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/form', params });

export const mesOrderTaskSave = (params?: any, data?: MesOrderTask | any) =>
  defHttp.postJson<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/save', params, data });

export const mesOrderTaskDelete = (params?: MesOrderTask | any) =>
  defHttp.get<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/delete', params });

export const mesOrderTaskOperatorFp = (params?: any) =>
  defHttp.postJson<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/operatorFp', params });

export const mesOrderTaskstopTask = (params?: MesOrderTask | any) =>
  defHttp.post<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/stopTask', params });

export const mesOrderTaskopenTask = (params?: MesOrderTask | any) =>
  defHttp.post<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/openTask', params });

export const mesOrderTaskcloseTask = (params?: MesOrderTask | any) =>
  defHttp.post<MesOrderTask>({ url: adminPath + '/mo/task/mesOrderTask/closeTask', params });